﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Registration.aspx.cs" Inherits="ProjectExercise.Registration" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
    <style type="text/css">
        .style1
        {
            width: 241px;
        }
        .style2
        {
            width: 248px;
        }
    </style>
</head>
<body>
    <form id="form1" runat="server">
    <div>
        <asp:ValidationSummary ID="ValidationSummary1" runat="server" 
            ValidationGroup="RegistrationGroup" />
    <table>
        <tr>
            <td><asp:Label ID="firstName" runat="server" Text="First Name:"></asp:Label></td>
            <td class="style1"><asp:TextBox ID="firstNameText" runat="server" Width="180px"></asp:TextBox>
            </td>
            <td class="style2">
                <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" 
                    ErrorMessage="First Name Field is Required" ControlToValidate="firstNameText" 
                    ForeColor="Red" ValidationGroup="RegistrationGroup">*</asp:RequiredFieldValidator>
                <asp:RegularExpressionValidator ID="RegularExpressionValidator2" runat="server" 
                    ControlToValidate="firstNameText" ErrorMessage="Must Have Length at least 6" 
                    ForeColor="Red" ValidationExpression=".{6}.*" 
                    ValidationGroup="RegistrationGroup"></asp:RegularExpressionValidator>
            </td>
        </tr>
        <tr>
            <td><asp:Label ID="lastName" runat="server" Text="Last Name"></asp:Label></td>
            <td class="style1"><asp:TextBox ID="lastNameText" runat="server" Width="180px"></asp:TextBox>
            </td>
            <td class="style2"></td>
        </tr>
        <tr>
            <td><asp:Label ID="title" runat="server" Text="Title"></asp:Label></td>
            <td class="style1"><asp:DropDownList ID="titleList" runat="server" Width="173px">
            <asp:ListItem>Please Select...</asp:ListItem>
            <asp:ListItem>Mr.</asp:ListItem>
            <asp:ListItem>Mrs.</asp:ListItem>
            <asp:ListItem>Ms.</asp:ListItem>
        </asp:DropDownList>
            </td>
            <td class="style2">
                <asp:RequiredFieldValidator ID="RequiredFieldValidator3" runat="server" 
                    ErrorMessage="Please Select One of Title List" ControlToValidate="titleList" 
                    ForeColor="Red" InitialValue="Please Select..." 
                    ValidationGroup="RegistrationGroup">*</asp:RequiredFieldValidator>
            </td>
        </tr>
        <tr>
            <td><asp:Label ID="gender" runat="server" Text="Gender"></asp:Label></td>
            <td class="style1">
                <asp:RadioButtonList ID="genderRadioButton" runat="server" Width="95px" 
                    Height="16px">
                    <asp:ListItem>Male</asp:ListItem>
                    <asp:ListItem>Female</asp:ListItem>
                </asp:RadioButtonList>
                
            </td>
            <td class="style2">
                <asp:RequiredFieldValidator ID="RequiredFieldValidator4" runat="server" 
                    ErrorMessage="Please Select the Gender Option" ControlToValidate="genderRadioButton" 
                    ForeColor="Red" ValidationGroup="RegistrationGroup">*</asp:RequiredFieldValidator></td>
                    <td></td>
        </tr>
        <tr>
            <td><asp:Label ID="email" runat="server" Text="Email"></asp:Label></td>
            <td class="style1"><asp:TextBox ID="emailText" runat="server" Width="180px"></asp:TextBox>
            </td>
            <td class="style2">
                <asp:RequiredFieldValidator ID="RequiredFieldValidator5" runat="server" 
                    ErrorMessage="Email Field is Required" ControlToValidate="emailText" 
                    ForeColor="Red" ValidationGroup="RegistrationGroup">*</asp:RequiredFieldValidator>
                <asp:RegularExpressionValidator ID="RegularExpressionValidator1" runat="server"
    ErrorMessage="Invalid email address."    ControlToValidate="emailText" 
    ValidationExpression="\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*" ForeColor="Red" 
                    ValidationGroup="RegistrationGroup"></asp:RegularExpressionValidator>
            </td>
        </tr>
        <tr>
            <td><asp:Label ID="phone" runat="server" Text="Phone"></asp:Label></td>
            <td class="style1"><asp:TextBox ID="phoneText" runat="server" Width="180px"></asp:TextBox>
            </td>
            <td class="style2">
                <asp:RequiredFieldValidator ID="RequiredFieldValidator6" runat="server" 
                    ErrorMessage="Phone Field is Required" ControlToValidate="phoneText" 
                    ForeColor="Red" ValidationGroup="RegistrationGroup">*</asp:RequiredFieldValidator>
                <asp:RegularExpressionValidator ID="RegularExpressionValidator3" runat="server" 
                    ControlToValidate="phoneText" ErrorMessage="Must be Numeric Value" 
                    ForeColor="Red" ValidationExpression="^(0|[0-9][0-9]*)$" 
                    ValidationGroup="RegistrationGroup"></asp:RegularExpressionValidator>
            </td>
        </tr>
        <tr>
            <td><asp:Label ID="fax" runat="server" Text="Fax"></asp:Label></td>
            <td class="style1"><asp:TextBox ID="faxText" runat="server" Width="180px"></asp:TextBox></td>
            <td class="style2"></td>
        </tr>
        <tr>
            <td><asp:Label ID="address1" runat="server" Text="Address 1"></asp:Label></td>
            <td class="style1">
                <asp:TextBox ID="address1Text" runat="server" TextMode="MultiLine"></asp:TextBox>
            </td>
            <td class="style2">
                <asp:RequiredFieldValidator 
                    ID="RequiredFieldValidator7" runat="server" 
                    ErrorMessage="Address 1 Field is Required" ControlToValidate="address1Text" 
                    ForeColor="Red" ValidationGroup="RegistrationGroup">*</asp:RequiredFieldValidator>
            </td>
        </tr>
        <tr>
            <td><asp:Label ID="address2" runat="server" Text="Address 2"></asp:Label></td>
            <td class="style1">
                <asp:TextBox ID="address2Text" runat="server" TextMode="MultiLine"></asp:TextBox>
                <br /></td>
             <td class="style2">
                 <asp:RequiredFieldValidator 
                    ID="RequiredFieldValidator8" runat="server" 
                    ErrorMessage="Address 2 Field is Required" ControlToValidate="address2Text" 
                    ForeColor="Red" ValidationGroup="RegistrationGroup">*</asp:RequiredFieldValidator>
                </td>
        </tr>
        <tr>
            <td></td>
            <td class="style1"><asp:CheckBox ID="agreement" 
                    Text="I Agree with Terms and Conditions" runat="server"/>
            </td>
            <td class="style2">
                <asp:CustomValidator runat="server" ID="CheckBoxRequired" EnableClientScript="true"
    OnServerValidate="CheckBoxRequired_ServerValidate"
    ClientValidationFunction="CheckBoxRequired_ClientValidate" ForeColor="Red" 
                    ErrorMessage="You must select Checkbox to proceed." 
                    ValidationGroup="RegistrationGroup">*</asp:CustomValidator>
            </td>
        </tr>
        <tr>
            <td></td>
            <td class="style1"><asp:Button ID="submit" runat="server" Text="Submit" 
                    onclick="submit_Click" /></td>
            <td class="style2"></td>
        </tr>
    </table>
   
    </div>
    </form>
</body>
</html>
